package com.ma.crawl_book.controller;


import com.ma.crawl_book.model.BookBean;
import com.ma.crawl_book.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Component
public class BookController {

    @Autowired
    BookService bookService;

    @ResponseBody
    @RequestMapping(value = "/book")
    public int insertBook(BookBean book) {
        System.out.println("controller");
        bookService.insertBook(book);
        return book.getId();
    }
}
